import Vue from 'vue'
import VueRouter from 'vue-router'

import FindMusic from '@/views/FindMusic/FindMusic.vue'
import Video from '@/views/Video/Video.vue'
import Recommend from '@/views/FindMusic/Recommend.vue'
import Song from '@/views/Song/Song.vue'
import PlayList from '@/views/PlayList/PlayList.vue'
import SongGroupAll from '@/views/FindMusic/SongGroupAll.vue'
import HighQualitySongGroup from '@/views/FindMusic/HighQualitySongGroup.vue'
import RecommendSongGroup from '@/views/FindMusic/RecommendSongGroup.vue'
import Ranking from '@/views/FindMusic/Ranking.vue'
import Mv from '@/views/Mv/Mv.vue'
import ExclusivePage from '@/views/Mv/ExclusivePage.vue'
import LastPlay from '@/views/LastPlay/LastPlay.vue'
import Album from '@/views/PlayList/Album.vue'
import MyLoveSong from '@/views/MyLoveSong/MyLoveSong.vue'

Vue.use(VueRouter)

const routes = [
  { path: '/', redirect: '/find-music' },
  {
    path: '/find-music',
    component: FindMusic,
    // 默认子路由
    children: [
      { path: '', component: Recommend },
      // 全部歌单
      { path: 'song-group-all', component: SongGroupAll },
      // 精品歌单
      { path: 'high-quality', component: HighQualitySongGroup },
      // 推荐歌单
      { path: 'recommend-song-group', component: RecommendSongGroup },
      // 排行榜
      { path: 'ranking', component: Ranking }
    ]
  },
  { path: '/video', component: Video },
  // 音乐
  { path: '/song', component: Song },
  // 歌单
  { path: '/playlist', component: PlayList },
  // MV
  { path: '/mv', component: Mv },
  // 独家放送
  { path: '/exclusive', component: ExclusivePage },
  // 最近播放
  { path: '/last-play', component: LastPlay },
  // 专辑
  { path: '/album', component: Album },
  // 我喜欢的音乐
  { path: '/my-love-song', component: MyLoveSong }
]

const router = new VueRouter({
  routes
})

export default router
